<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="uct" uri="/WEB-INF/uct.tld" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <%@ include file="/common/sale/include/common-base.jsp"%>	
  <title>平台资金明细 | ${titleName}</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
</head>
<body class="hold-transition ${sysColor} sidebar-mini">
<div class="wrapper">

  <!-- top start -->
  <%@include file="/common/sale/top.jsp" %>
  <!-- top end -->
  <!-- left start -->
  <%@include file="/common/sale/left.jsp" %>
  <!-- left end-->

  <div class="content-wrapper">
   <!-- -
		<ol class="breadcrumb bgblue">
			<li>
				<span class="label label-danger font14" >结算管理 / 平台资金流水明细</span>
			</li>
		</ol>
 -->
		
    <!-- Main start -->

<section class="content">
      <div class="row">
        <div class="col-xs-12">
        
        
          <!------  start ------->
          <div class="box box-info">
             <!--搜索title  start --> 
	          <div class="box-header with-border">
                 <h3 class="box-title"><i class="fa fa-money"></i> 平台资金流水明细</h3>
                 <div class="box-tools pull-right">
	               <!--  <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
	                </button>
	                 -->
                 </div>
              </div>
            <!--搜索title  end --> 
            <div class="box-body">
            	
			  <div class="callout callout-danger" style="margin-top: 10px;">
                 <form id="searchFrom" class="form-horizontal">
					<input type="hidden" name="doCode" value="F006"/>
					      平台资金账号：<portal:config varKey='jys_funds_id'/><!-- 6228000000000000 -->
					<input type="hidden" name="settleAccountNo"  value="<portal:config varKey='jys_funds_id'/>" />
				</form>
             </div>
              <table id="example" class="table table-bordered table-hover" >
                <thead class="bg-success">
                <tr>
                  <th>发生日期</th>
                  <th>资金账号</th>
                  <th>操作描述</th>
                  <th>操作类型</th>
                  <th>操作金额</th>
                  <th>剩余金额</th>
                  <th>发生时间</th>
                  <th>对手账号</th>
                </tr>
                </thead>
                <tbody id="myList">
                </tbody>
              </table>
              
         	    <center>
    	  			  <ul id="pageList"></ul>
        		</center>
            </div>
	     </div>
	     <!------- end -------->

        
        
        
        </div>
      </div>
    </section>
    <!-- Main end -->
  </div>
  <!-- /.content-wrapper -->
  <!-- foot start -->
  <%@include file="/common/sale/foot.jsp" %>
  <!-- foot start -->
  
</body>
	<script type="text/template" id="dataList">
	  		<? for ( var i = 0; i < rows.length; i++) {?>
				<tr>
					<td><?=rows[i].transDate?></td>
					<td><?=rows[i].userId?></td>
					<td><?=rows[i].actionName?></td>
					<td><?=rows[i].actionType?></td>
					<td>
						<?if(rows[i].direction =="in" ){?>+<?}else{?>-<?}?><?=rows[i].amount/100?>
					</td>
					<td><?=rows[i].leaveAmount/100?></td>
					<td><?=rows[i].createTime?></td>
					<td><?=rows[i].opacctId?></td>
				</tr>
     		<?}?>
	</script>

<script>

var id;
$(function () {
	getTableData();
	
  });

//设置模态框隐藏事件钩子  
$( '#my_modal' ).on( 'hide.bs.modal' ,function(e){  
	cleanData('userFormData');
}); 

//设置模态框隐藏事件钩子  
$( '#my_modal' ).on( 'show.bs.modal' ,function(e){  
	$.ajax({
	    type:'get',
	    url:'${ctx}/sendPage/token?token=true',
	    dataType:'json',
	    success: function(myData){
	    	//console.log(myData);
			 $('#formToken').val(myData);
	  	}
	});	
}); 

function cleanData(id){
	$(':input','#'+id)  
	 .not(':button, :submit, :reset, :hidden')  
	 .val('')  
	 //.removeAttr('checked')  
	 .removeAttr('selected'); 
}
var clickMenu= 'funds-platform-all';
function getTableData(){
	deleteAllRow('example');
	$.ajax({
		   type:'get',
		   url: common_list_url,//user_search_url,
		   data:$('#searchFrom').serialize()+getCurrentPage(common_list_url+"?"+$('#searchFrom').serialize(),10),
		   dataType:'json',
		   success: function(myData){
			   console.log(myData);
			var data = baidu.template('dataList',eval(myData));  
			$("#myList").html(data);
			  var option= {
					   ele:$("#pageList")[0],
					   total:myData.total,
					   fn:getTableData,
					   url:common_list_url+"?"+$('#searchFrom').serialize()
				   }
			generatePages(option);
		   }
		});	
  }
  
function deleteAllRow(tableId){
	var tb = document.getElementById(tableId);
	if(tb){
	     var rowNum=tb.rows.length;
	     for (i=1;i<rowNum;i++){
	         tb.deleteRow(i);
	         rowNum=rowNum-1;
	         i=i-1;
	     }
     }
}

function refresh(){
    //window.location.reload();
	getTableData();
}

</script>

</html>
